import { UPDATE_MODEL_EVENT } from '@jctech/constants/event';
import { controlProps } from '@jctech/components/common/props';
import { propTypes } from '@jctech/utils/propTypes';
import type { PropType } from 'vue';

export const selectProps = {
  ...controlProps,
  clearable: propTypes.bool.def(false),
  modelValue: {
    type: [Number, String, Array],
    default: undefined
  },
  isMutual: propTypes.bool.def(true),
  hasEmpty: propTypes.bool.def(true),
  emptylabel: propTypes.string.def(''),
  emptyvalue: propTypes.string.def(''),
  source: {
    type: Array as PropType<Array<{ text: string; value: any }>>,
    default() {
      return [];
    }
  }
};

export const selectEmits = [UPDATE_MODEL_EVENT];
